<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateContactoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateContactoLabel_idContacto}" for="idContacto" />
                    <h:inputText id="idContacto" value="#{contactoController.selected.idContacto}" title="#{bundle.CreateContactoTitle_idContacto}" required="true" requiredMessage="#{bundle.CreateContactoRequiredMessage_idContacto}"/>
                    <h:outputLabel value="#{bundle.CreateContactoLabel_nome}" for="nome" />
                    <h:inputText id="nome" value="#{contactoController.selected.nome}" title="#{bundle.CreateContactoTitle_nome}" required="true" requiredMessage="#{bundle.CreateContactoRequiredMessage_nome}"/>
                    <h:outputLabel value="#{bundle.CreateContactoLabel_detalhe}" for="detalhe" />
                    <h:inputText id="detalhe" value="#{contactoController.selected.detalhe}" title="#{bundle.CreateContactoTitle_detalhe}" />
                    <h:outputLabel value="#{bundle.CreateContactoLabel_telef}" for="telef" />
                    <h:inputText id="telef" value="#{contactoController.selected.telef}" title="#{bundle.CreateContactoTitle_telef}" />
                    <h:outputLabel value="#{bundle.CreateContactoLabel_email}" for="email" />
                    <h:inputText id="email" value="#{contactoController.selected.email}" title="#{bundle.CreateContactoTitle_email}" />
                    <h:outputLabel value="#{bundle.CreateContactoLabel_fkFuncionario}" for="fkFuncionario" />
                    <h:selectOneMenu id="fkFuncionario" value="#{contactoController.selected.fkFuncionario}" title="#{bundle.CreateContactoTitle_fkFuncionario}" >
                        <f:selectItems value="#{funcionarioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateContactoLabel_fkCliente}" for="fkCliente" />
                    <h:selectOneMenu id="fkCliente" value="#{contactoController.selected.fkCliente}" title="#{bundle.CreateContactoTitle_fkCliente}" >
                        <f:selectItems value="#{clienteController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateContactoLabel_fkParceiro}" for="fkParceiro" />
                    <h:selectOneMenu id="fkParceiro" value="#{contactoController.selected.fkParceiro}" title="#{bundle.CreateContactoTitle_fkParceiro}" >
                        <f:selectItems value="#{parceiroController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{contactoController.create}" value="#{bundle.CreateContactoSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{contactoController.prepareList}" value="#{bundle.CreateContactoShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateContactoIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
